package com.yanqu.road.logic.sort;

import com.yanqu.road.entity.rank.cross.CrossUserDecoration;

import java.util.Comparator;

public class CrossMammonSort implements Comparator<CrossUserDecoration> {
    @Override
    public int compare(CrossUserDecoration o1, CrossUserDecoration o2) {
        int result = (int) (o2.getEndTime() - o1.getEndTime());
        if (result != 0) {
            return result;
        }
        long time = o1.getModifyTime() - o2.getModifyTime();
        result = time > 0 ? 1 : (time == 0 ? 0 : -1);
        return result;
    }
}
